﻿
@{
    ViewBag.Title = "getuserlist";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section style{
    <link rel="stylesheet" href="~/Content/plugins/bootstrap-table/bootstrap-table.css">
}

<h2>getuserlist</h2>


<div class="row">
    <div class="col-md-12">
        <table class="table table-hover" id="tradeList">
            <thead>
                <tr>
                    <th data-field="UserName">用户昵称</th>
                    <th data-field="UserPhone">用户手机号</th>
                    <th data-field="LastDate">最后登录时间</th>
                    <th data-field="CreateDate">创建时间</th>
                    <th data-field="LoginAt">登录次数</th>
                    <th data-formatter="oprate">操作</th>
                </tr>
            </thead>
            @*

                <tbody>
        <tr>
            <td>1</td>
            <td>爱哭鬼</td>
            <td>13340334242</td>
            <td>2023-3-4 21:52:18</td>
            <td>2023-3-4 21:52:18</td>
            <td>10</td>
        </tr>
         </tbody>
            *@

        </table>
    </div>
</div>

@section scripts{

    <script src="~/Content/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="~/Content/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>

    <script type="text/javascript">
        var inittableing = function (tableData) {
            $('#tradeList').bootstrapTable({
                url: '/Home/getulist',
                method: "post",
                pagination: true,
                dataField: "data",
                queryParams: queryParams,
                sidePagination: 'server',//指定服务器端分页
                pageSize: 10,//单页记录数
                pageList: [10, 20, 30, 40],//分页步进值
                responseHandler: function (res) {
                    return {
                        total: res.total,//总页数
                        data: res.data   //数据
                    };
                },
            })
        }


        function queryParams(params) {
            return {
                PageSize: params.limit,
                PageNum: params.offset / params.limit + 1,
                /*UserName:$('#searchName').val()*/
            }
        }

        function oprate(value, row, index) {
            debugger
            return "<a href='#'>删除</a>"
        }

        inittableing();

        function refresh() {
          //  $('#').bootstrapTable('refresh', { url: "r-url" });
        }
    </script>
}
